package main;

import java_cup.runtime.*;


%%

%cup
%line
%column
%unicode
%class NameLexer

%s TRAP

NEWLINE = \r|\n|\r\n
SPACE = [ \t\f]
WHITESPACE = {SPACE} | {NEWLINE}
ANY = (. | NEWLINE)*

ELEMENT = .+

%%

^{ELEMENT}$ {
	Main.addElement(yytext());
}

{WHITESPACE}* {
	/* Ignore whitespaces */
}

. {
	System.out.println("Error: Archivo mal formado.(Fila: " + (yyline + 1) + " Columna: " + (yycolumn + 1) + ")");
	yybegin(TRAP);
}

<TRAP> {ANY} {
}